package jmine.tec.datadigester;

import bancosys.tec.exception.LocalizedMessageHolder;
import bancosys.tec.exception.MessageCreator;
import bancosys.tec.exception.MessageCreatorHelper;

/**
 * @author lundberg
 */
public enum DataDigesterMessages implements MessageCreator {
    EXECUTION_STATUS_ALERT(0, "jmine.tec.execution.status.alert"),

    EXECUTION_STATUS_FAIL(0, "jmine.tec.execution.status.fail"),

    NO_DRIVER_FOR_CODE(1, "datadigester.noDriverForCode"),

    GENERIC_PROCESSOR_ERROR(0, "datadigester.genericProcessorError"),

    NO_PROCESSOR_FOR_CODE_WITH_NAME(2, "datadigester.noProcessorForCodeWithName"),

    EXECUTION_ITEM_STATUS_ALERT(0, "jmine.tec.execution.item.status.alert"),

    FREQUENCY_MONTHLY(0, "datadigester.frequency.monthly"),

    FREQUENCY_NONE(0, "datadigester.frequency.none"),

    ERROR_CREATING_DRIVER(2, "datadigester.errorCreatingDriver"),

    BEAN_TRAVERSER_FAILURE(0, "datadigester.beanTraverserFailure"),

    FILE_REGISTRY_NOT_FOUND(1, "datadigester.fileRegistryNotFound"),

    EXECUTION_ITEM_STATUS_UPDATE(0, "jmine.tec.execution.item.status.update"),

    EXECUTION_ITEM_STATUS_IGNORE(0, "jmine.tec.execution.item.status.ignore"),

    ERROR_READING_FILE(0, "datadigester.errorReadingFile"),

    EXECUTION_ITEM_STATUS_OK(0, "jmine.tec.execution.item.status.ok"),

    GENERIC_DATA_DIGESTER_ERROR_WITH_FILE_NAME(1, "datadigester.genericDataDigesterErrorWithFileName"),

    INCORRECT_MONTH_FOR_FILE(2, "datadigester.incorrectMonthForFile"),

    EXECUTION_STATUS_RUNNING(0, "jmine.tec.execution.status.running"),

    ERROR_READING_DRIVERS_FILE(1, "datadigester.errorReadingDriversFile"),

    EXECUTION_ITEM_STATUS_INSERT(0, "jmine.tec.execution.item.status.insert"),

    FREQUENCY_DAILY(0, "datadigester.frequency.daily"),

    DRIVERS_FILE_NOT_INJECTED(0, "datadigester.driversFileNotInjected"),

    GENERIC_DATA_DIGESTER_ERROR(0, "datadigester.genericDataDigesterError"),

    EXECUTION_STATUS_SUCESS(0, "jmine.tec.execution.status.sucess"),

    UNABLE_TO_CREATE_TMP_FILE(0, "datadigester.unableToCreateTmpFile"),

    INCORRECT_DATE_FOR_FILE(2, "datadigester.incorrectDateForFile"),

    EXECUTION_ITEM_STATUS_NOT_OK(0, "jmine.tec.execution.item.status.not_ok"),

    NO_PROCESSOR_FOR_CODE(1, "datadigester.noProcessorForCode"),

    EXECUTION_ITEM_STATUS_NOT_EXECUTED(0, "jmine.tec.execution.item.status.not_executed"),

    FILE_PROCESS_IN_EXECUTION_TRY_LATER(0, "datadigester.file.process.in.execution.try.later"),

    PACOTE_ERRO_LENDO_ARQUIVO_ZIP(0, "datadigester.pacote.erro.lendo.arquivo.dentro.do.zip"),

    PACOTE_ERRO_INESPERADO(0, "datadigester.pacote.erro.inesperado"),

    PACOTE_ERRO_LISTA_ARQUIVOS_NAO_ENCONTRADA(0, "datadigester.pacote.erro.lista.arquivos.nao.encontrada"),

    PACOTE_ERRO_LISTA_ARQUIVOS_VAZIA(0, "datadigester.pacote.erro.lista.arquivos.vazia"),

    PACOTE_FORMATO_INESPERADO(1, "datadigester.pacote.formato.inesperado"),

    PACOTE_ARQUIVO_NAO_ENCONTRADO(1, "datadigester.pacote.arquivo.nao.encontrado"),

    MAPEAMENTO_POSICIONAL_NAO_ANOTADO(1, "datadigester.positional.layout.not.annotated");

    private final MessageCreator delegate;

    /**
     * Construtor
     * 
     * @param nargs nargs
     * @param key key
     */
    private DataDigesterMessages(int nargs, String key) {
        this.delegate = MessageCreatorHelper.creator("jmine-tec-data-digester-messages", key, nargs);
    }

    /**
     * {@inheritDoc}
     */
    public LocalizedMessageHolder create(Object... arguments) {
        return this.delegate.create(arguments);
    }

    /**
     * {@inheritDoc}
     */
    public int getExpectedArguments() {
        return this.delegate.getExpectedArguments();
    }
}
